package com.cskaoyan.controller.wxcontroller;

import com.cskaoyan.bean.vo.BaseRespVo;
import com.cskaoyan.bean.vo.CataLogIndexVO;
import com.cskaoyan.bean.vo.CatalogCurrentVO;
import com.cskaoyan.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ckd
 * @description 微信目录模块
 */
@SuppressWarnings("all")
@RestController
@RequestMapping("wx/catalog")
public class CatalogController {
    @Autowired
    CategoryService categoryService;

    @RequestMapping("current")
    public BaseRespVo catalogCurrent(Integer id) {
        CatalogCurrentVO catalogCurrentVO = categoryService.catalogCurrent(id);
        return BaseRespVo.ok(catalogCurrentVO,"成功");
    }

    @RequestMapping("index")
    public BaseRespVo catalogIndex() {
        CataLogIndexVO cataLogIndexVO = categoryService.catalogIndex();
        System.out.println(cataLogIndexVO);
        return BaseRespVo.ok(cataLogIndexVO, "成功");
    }

}
